﻿using System.IO;
using System.Web;

namespace netaddICTs.Umb.ProtectedMedia.Business.IO {

    internal class LocalFolderStorageImpl : StorageImpl, IFileStorage {
    
        public LocalFolderStorageImpl(string path) : base(path) {}

        #region IFileStorageImplementation Members

        public bool Create(int mediaNodeId, HttpPostedFile postedFile){
            return Create(string.Concat(Path, PathSeparator, mediaNodeId), postedFile);
        }

        public bool Delete(int mediaNodeId){
            return Delete(string.Concat(Path, PathSeparator, mediaNodeId));
        }


        public long CalculateBytes(int mediaNodeId, HttpPostedFile postedFile){
            return CalculateBytes(string.Concat(Path, PathSeparator, mediaNodeId, PathSeparator, postedFile.FileName));
        }

        #endregion
    }
}